package com.toutiao.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.base.entity.QueryParams;
import com.toutiao.dao.NewsMapper;
import com.toutiao.dao.model.News;
import com.toutiao.dao.model.NewsExample;
import com.toutiao.daoEx.NewsMapperEx;
import com.toutiao.daoEx.model.NewsEx;

@Service
public class NewsService {
	@Autowired
	private NewsMapper newsMapper;
	@Autowired
	private NewsMapperEx newsMapperEx;

	public int countByExample(NewsExample example) {
		return this.newsMapper.countByExample(example);
	}

	public News selectByPrimaryKey(Integer id) {
		return this.newsMapper.selectByPrimaryKey(id);
	}

	public List<News> selectByExample(NewsExample example) {
		return this.newsMapper.selectByExample(example);
	}

	public List<News> selectByExampleWithBLOBs(NewsExample example) {
		return this.newsMapper.selectByExampleWithBLOBs(example);
	}

	public int deleteByPrimaryKey(Integer id) {
		return this.newsMapper.deleteByPrimaryKey(id);
	}

	public int updateByPrimaryKeySelective(News record) {
		return this.newsMapper.updateByPrimaryKeySelective(record);
	}

	public int updateByPrimaryKeyWithBLOBs(News record) {
		return this.newsMapper.updateByPrimaryKeyWithBLOBs(record);
	}

	public int updateByPrimaryKey(News record) {
		return this.newsMapper.updateByPrimaryKey(record);
	}

	public int deleteByExample(NewsExample example) {
		return this.newsMapper.deleteByExample(example);
	}

	public int updateByExampleSelective(News record, NewsExample example) {
		return this.newsMapper.updateByExampleSelective(record, example);
	}

	public int updateByExampleWithBLOBs(News record, NewsExample example) {
		return this.newsMapper.updateByExampleWithBLOBs(record, example);
	}

	public int updateByExample(News record, NewsExample example) {
		return this.newsMapper.updateByExample(record, example);
	}

	public int insert(News record) {
		return this.newsMapper.insert(record);
	}

	public int insertSelective(News record) {
		return this.newsMapper.insertSelective(record);
	}

	public List<NewsEx> selectAppList(QueryParams.Builder builder){
		return this.newsMapperEx.selectAppList(builder);
	}
	
	public List<NewsEx> selectList(Map<String, Object> map){
		return this.newsMapperEx.selectList(map);
	}	
	
	public int updateByPrimaryKeys(int id){
		return this.newsMapperEx.updateByPrimaryKeys(id);
	}
}
